package com.fbty.mt.utils;

import java.util.Random;

public class OnlyCodeUtil {
	static char[] codeSequence={'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 
			'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 
			'x', 'y', 'z','1','2','3','4','5','6','7','8','9','0'};
	static char[] numSequence={};
	public static String randomUsername(){
		Random random = new Random();
		StringBuffer randomCode=new StringBuffer(); 
		for (int i = 0; i <5; i++) {
			String strRand=String.valueOf(codeSequence[random.nextInt(36)]); 
			//将产生的四个随机数组合在一起。 
			randomCode.append(strRand);
		}
		
		return randomCode.toString();
	}
	public static String randomPassword(){
		Random random = new Random();
		StringBuffer randomCode=new StringBuffer(); 
		for (int i = 0; i <5; i++) {
			String strRand=String.valueOf(codeSequence[random.nextInt(36)]); 
			//将产生的四个随机数组合在一起。 
			randomCode.append(strRand);
		}
		
		return randomCode.toString();
	}

	public static void main(String[] args) {
		System.out.println(randomUsername());
		System.out.println(randomPassword());
	}
}
